/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author USER
 */
@Entity
@Table(name = "calisan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Calisan.findAll", query = "SELECT c FROM Calisan c"),
    @NamedQuery(name = "Calisan.findByIdCalisan", query = "SELECT c FROM Calisan c WHERE c.idCalisan = :idCalisan"),
    @NamedQuery(name = "Calisan.findBySistemIsim", query = "SELECT c FROM Calisan c WHERE c.sistemIsim = :sistemIsim"),
    @NamedQuery(name = "Calisan.findBySistemSifre", query = "SELECT c FROM Calisan c WHERE c.sistemSifre = :sistemSifre"),
    @NamedQuery(name = "Calisan.findByAd", query = "SELECT c FROM Calisan c WHERE c.ad = :ad"),
    @NamedQuery(name = "Calisan.findBySoyad", query = "SELECT c FROM Calisan c WHERE c.soyad = :soyad"),
    @NamedQuery(name = "Calisan.findByDogumTarihi", query = "SELECT c FROM Calisan c WHERE c.dogumTarihi = :dogumTarihi"),
    @NamedQuery(name = "Calisan.findByIseGiris", query = "SELECT c FROM Calisan c WHERE c.iseGiris = :iseGiris")})
public class Calisan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idCalisan")
    private Integer idCalisan;
    @Basic(optional = false)
    @Column(name = "sistemIsim")
    private String sistemIsim;
    @Basic(optional = false)
    @Column(name = "sistemSifre")
    private String sistemSifre;
    @Column(name = "ad")
    private String ad;
    @Column(name = "soyad")
    private String soyad;
    @Column(name = "dogumTarihi")
    @Temporal(TemporalType.DATE)
    private Date dogumTarihi;
    @Column(name = "iseGiris")
    @Temporal(TemporalType.DATE)
    private Date iseGiris;
    @JoinColumn(name = "calisanTipId", referencedColumnName = "idCalisanTip")
    @ManyToOne(optional = false)
    private Calisantip calisanTipId;

    public Calisan() {
    }

    public Calisan(Integer idCalisan) {
        this.idCalisan = idCalisan;
    }

    public Calisan(Integer idCalisan, String sistemIsim, String sistemSifre) {
        this.idCalisan = idCalisan;
        this.sistemIsim = sistemIsim;
        this.sistemSifre = sistemSifre;
    }

    public Integer getIdCalisan() {
        return idCalisan;
    }

    public void setIdCalisan(Integer idCalisan) {
        this.idCalisan = idCalisan;
    }

    public String getSistemIsim() {
        return sistemIsim;
    }

    public void setSistemIsim(String sistemIsim) {
        this.sistemIsim = sistemIsim;
    }

    public String getSistemSifre() {
        return sistemSifre;
    }

    public void setSistemSifre(String sistemSifre) {
        this.sistemSifre = sistemSifre;
    }

    public String getAd() {
        return ad;
    }

    public void setAd(String ad) {
        this.ad = ad;
    }

    public String getSoyad() {
        return soyad;
    }

    public void setSoyad(String soyad) {
        this.soyad = soyad;
    }

    public Date getDogumTarihi() {
        return dogumTarihi;
    }

    public void setDogumTarihi(Date dogumTarihi) {
        this.dogumTarihi = dogumTarihi;
    }

    public Date getIseGiris() {
        return iseGiris;
    }

    public void setIseGiris(Date iseGiris) {
        this.iseGiris = iseGiris;
    }

    public Calisantip getCalisanTipId() {
        return calisanTipId;
    }

    public void setCalisanTipId(Calisantip calisanTipId) {
        this.calisanTipId = calisanTipId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCalisan != null ? idCalisan.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Calisan)) {
            return false;
        }
        Calisan other = (Calisan) object;
        if ((this.idCalisan == null && other.idCalisan != null) || (this.idCalisan != null && !this.idCalisan.equals(other.idCalisan))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Calisan[ idCalisan=" + idCalisan + " ]";
    }
    
}
